<?php
header("Content-type: text/html; charset=utf-8");
$conn=mysql_connect('127.0.0.1:3306','betty','123qwe');
if(!$conn){
	die('连接失败');
}
echo '连接成功';
mysql_query("SET NAMES 'utf8'");
//$c=mysql_select_db('betty',$conn);
$dbname='betty';
$c=mysql_query("USE `{$dbname}`",$conn);
if(!$c){
	die('选择失败');
}
echo '选择成功<br/>';
$sql="SELECT * FROM `scord` WHERE 1=1 ";
$resource=mysql_query($sql,$conn);
while($row=mysql_fetch_array($resource,MYSQL_BOTH)){
	//print_r($row);
	echo 'id='.$row[0].', name='.$row[1].'<br/>';
	echo 'id='.$row['id'].', name='.$row['realname'].'<br/>';
}
?>